package com.zareal.ymcc.web.controller;

import com.zareal.ymcc.result.JSONResult;
import com.zareal.ymcc.service.ICreatTokenCommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/createToken")
public class CreatTokenCommonController {
    @Autowired
    private ICreatTokenCommonService creatTokenCommonService;
    /**
     * 生成购买订单的时候防重token
     */
    @RequestMapping(value="/{courseIds}",method= RequestMethod.GET)
    public JSONResult getToken(@PathVariable("courseIds") String courseIds){
        String token = creatTokenCommonService.getToken(courseIds);
        return JSONResult.success(token);
    }
}
